
var fnCustomAdd = function () {
    const_EditEntity = "salProvisionProductPack";
    var pagetitle = "新增佣金产品分类";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity));
    parent.NeedRefreshPage = this;
}

var fnCustomEdit = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    const_EditEntity = "salProvisionProductPack";
    var pagetitle = "修改佣金产品分类—" + record.getData("Name");
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID)));
    parent.NeedRefreshPage = this;
}

var SelectPost = function () {
    var _v = $("#Products").attr("SValue").split(",");
    var _t = $("#Products").val().split(",");
    $(_v).each(function (index) {
        obj = clone(eval(_DataTable.Entity));
        obj.ProductID = _v[index];
        obj.ProductName = _t[index];
        _DataTable.AddRow(obj);
    });

    //alert($(this).attr("SValue"));
}

//var SelectPost = function () {
//    setTimeout( $("#ProductName").val($("#ProdcutID").val()),50);
//}


//var _callBack = function (status) {
//    //alert(FormulaData);
//    if (status == 1) {
//        var editwindow = document.getElementById("EditUIWindow");
//        if (editwindow) {
//           //alert( editwindow.contentWindow.getCondition());
//        };
//    }
//}

//var fnQueryRe = function (v) {
//    $("#Condition").val(v);
//}

//if (typeof ($) != "undefined") {
//    $(document).ready(function () {
//        $("#btnSetCondition").click(function () { //设置表达式
//            document.getElementById("EditUIWindow").src = "QueryForm.aspx?entity=V_CrmCommisionAll&flag=2&r=" + Math.random();
//            setTimeout(function () {
//                $("#dialogArea").fbmodal({
//                    title: "公式设置",
//                    cancel: "退出",
//                    okay: "确定",
//                    modal: true,
//                    okaybutton: true,
//                    cancelbutton: true,
//                    buttons: true,
//                    opacity: 0.0,
//                    fadeout: true,
//                    overlayclose: true,
//                    modaltop: "15%",
//                    modalwidth: "550",
//                    modalheight: "270"
//                }, _callBack);
//            }, 100);
//        });
//    })
//}aq




//var fnGetRoles = function () {
//    var entity = fnGetData("V_CrmCommisionRoleData", "");
//    if (entity != null) {
//        return entity.rows;
//    }
//    return null;
//}

//var ds_Detail_RoleName;
//if (typeof ($) == "undefined") {
//    ds_Detail_RoleName = fnGetRoles();
//}